package com.example.scaffold_demo.db.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.scaffold_demo.db.entity.CreditCard;
import com.example.scaffold_demo.db.entity.People;

import com.example.scaffold_demo.db.greendao.CreditCardDao;
import com.example.scaffold_demo.db.greendao.PeopleDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig creditCardDaoConfig;
    private final DaoConfig peopleDaoConfig;

    private final CreditCardDao creditCardDao;
    private final PeopleDao peopleDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        creditCardDaoConfig = daoConfigMap.get(CreditCardDao.class).clone();
        creditCardDaoConfig.initIdentityScope(type);

        peopleDaoConfig = daoConfigMap.get(PeopleDao.class).clone();
        peopleDaoConfig.initIdentityScope(type);

        creditCardDao = new CreditCardDao(creditCardDaoConfig, this);
        peopleDao = new PeopleDao(peopleDaoConfig, this);

        registerDao(CreditCard.class, creditCardDao);
        registerDao(People.class, peopleDao);
    }
    
    public void clear() {
        creditCardDaoConfig.clearIdentityScope();
        peopleDaoConfig.clearIdentityScope();
    }

    public CreditCardDao getCreditCardDao() {
        return creditCardDao;
    }

    public PeopleDao getPeopleDao() {
        return peopleDao;
    }

}
